package com.zyh.domain;

public class Student extends People{
    private int score;


    public Student() {
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public Student(int score) {
        this.score = score;
    }
//    天龙5步，重写toString方法

    @Override
    public String toString() {
        return "Student{" +
                "score=" + score +
                '}';
    }

//    天龙6步，重写hashCode()和equals()方法

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Student student = (Student) o;

        return score == student.score;
    }

    @Override
    public int hashCode() {
        return score;
    }
}
